import { ApiProperty } from '@nestjs/swagger';
import { IsString, IsOptional, IsEnum } from 'class-validator';
import { OrderStatus } from '../entities/order.entity';

export class UpdateOrderDto {
  @ApiProperty({ description: '订单状态', enum: OrderStatus, required: false })
  @IsOptional()
  @IsEnum(OrderStatus, { message: '订单状态无效' })
  status?: OrderStatus;

  @ApiProperty({ description: '收货地址', example: '北京市海淀区中关村大街1号', required: false })
  @IsOptional()
  @IsString({ message: '收货地址必须是字符串' })
  shipping_address?: string;

  @ApiProperty({ description: '联系电话', example: '13800138000', required: false })
  @IsOptional()
  @IsString({ message: '联系电话必须是字符串' })
  phone?: string;

  @ApiProperty({ description: '备注', example: '请尽快发货', required: false })
  @IsOptional()
  @IsString({ message: '备注必须是字符串' })
  note?: string;
}